package example.动态规划.连续子集;

import java.util.HashSet;

/**
 * 给定一个数组arr，返回arr的最长无重复元素子数组的长度，无重复指的是所有数字都不相同。
 * 子数组是连续的，比如[1,3,5,7,9]的子数组有[1,3]，[3,5,7]等等，但是[1,3,7]不是子数组
 * <p>
 * NC41 最长无重复子数组
 */
public class Demo1 {
    // https://www.nowcoder.com/practice/b56799ebfd684fb394bd315e89324fb4?tpId=188&&tqId=38553&rp=1&ru=/ta/job-code-high-week&qru=/ta/job-code-high-week/question-ranking
    public static int maxLength(int[] arr) {
        HashSet<Integer> integers = new HashSet<>();
        int maxLen = 0;
        int left = 0, right = arr.length - 1;
        while (left < right) {

        }
        return maxLen;
    }

    public static void main(String[] args) {
        int[] ints = new int[]{2, 2, 3, 4, 3};
        System.out.println(maxLength(ints));
    }
}
